package horncomb.bpm.hrsm.raw;

import horncomb.bpm.BpmContextHolder;
import horncomb.bpm.process.core.ExecutionContext;
import horncomb.bpm.process.core.ProcessInstance;
import horncomb.bpm.process.def.Action;

/**
 * @author Daniel
 */
public class OpenResourceDispatchAction implements Action {
	private static final long serialVersionUID = 6725627706349509389L;

	/**
	 * {@inheritDoc}
	 */
	public void execute(ExecutionContext context) {
		// if (context.getContextModel() instanceof Object) {
		// for(){
		// }
		// }

		// BpmContextHolder.getContext().getProcessManagementService().start(
		// context.getToken(), "verifyProc1", pr1);

		PersonalResource pr1 = new PersonalResource();
		pr1.setId("res1");
		pr1.setName("资源1");
		ProcessInstance procInst = BpmContextHolder.getContext()
				.getProcessManagementService().start(context.getToken(),
						"verifyProc1", pr1);

		PersonalResource pr2 = new PersonalResource();
		pr2.setId("res2");
		pr2.setName("资源2");
		procInst = BpmContextHolder.getContext().getProcessManagementService()
				.start(context.getToken(), "verifyProc2", pr2);
	}
}
